package com.rrjjg.app.admin.module.enums;

import lombok.Getter;

/**
 * ----------------------------------------------------------------------------- <br>
 * 功能 :  <br>
 * ----------------------------------------------------------------------------- <br>
 * 作者 : Vayne <br>
 * 时间 : 2023/4/9 <br>
 */
@Getter
public enum EurekaStatus {
    UP(0,"UP"),
    OUT_OF_SERVICE(1,"OUT_OF_SERVICE"),
    UNKNOWN(2,"") ;

    private int code;

    private String val;

    EurekaStatus(int code, String val) {
        this.code = code;
        this.val = val;
    }

    public static EurekaStatus getByCode(int code){
        for (EurekaStatus value : values()) {
            if(value.code==code){
                return value;
            }
        }
        return UNKNOWN;
    }
}
